Skip to content
Programming101
Programming101

Learn everything about programming

  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programming101

Learn everything about programming

HackerEarth [Only for Data Engineering] – Bank Data Consistency Check problem solution

YASH PAL, 31 July 2024
In this HackerEarth [Only for Data Engineering] – Bank Data Consistency Check problem solution Bank X contains a database of account numbers and debit cards mapped to each other. Now due to some technical issues, the data suddenly got deleted. But now the bank is left with a list of pairs of integers but they don’t know which of them is the debit card no. and which one is the account number.
It is clear that an account can have multiple debit cards linked to it, but it is not possible that a debit card is linked to more than one accounts.
You need to check if the given data is recoverable or not. If it is consistent then you need to also find what is the account number and what is the debit card number. It is guaranteed that the input data is designed in a way that there is only one unique correct answer. 
If for a pair it is impossible to find, you need to print -1 -1.
hackerEarth [Only for Data Engineering] - Bank Data Consistency Check problem solution

HackerEarth [Only for Data Engineering] – Bank Data Consistency Check problem solution.

#include<bits/stdc++.h>
#define LL long long int
#define M 1000000007
#define reset(a) memset(a,0,sizeof(a))
#define rep(i,j,k) for(i=j;i<=k;++i)
#define per(i,j,k) for(i=j;i>=k;--i)
#define print(a,start,end) for(i=start;i<=end;++i) cout<<a[i];
#define endl "n"
LL pow(LL a,LL b,LL m){LL x=1,y=a;while(b > 0){if(b%2 == 1){x=(x*y);if(x>m) x%=m;}y = (y*y);if(y>m) y%=m;b /= 2;}return x%m;}
LL gcd(LL a,LL b){if(b==0) return a; else return gcd(b,a%b);}
LL gen(LL start,LL end){LL diff = end-start;LL temp = rand()%start;return temp+diff;}
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
}
coding problems

Post navigation

Previous post
Next post
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
  • Hackerrank Day 14 scope 30 days of code solution
©2025 Programming101 | WordPress Theme by SuperbThemes