Hackearth's Data Structures solutions( Takeoff, Help Jarvis! , Pairs Having Similar Elements ) :
Problem 4: Takeoff Solution: (in c++) ( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder) #include< bits/stdc++.h > using namespace std ; int main () { int t ; cin >> t ; while ( t --) { long long n , p , q , r , i , check , ct = 0 ; cin >> n >> p >> q >> r ; for ( i = 1 ; i <= n ; i ++) { check = 0 ; if ( i % p == 0 ) { check ++; } if ( i % q == 0 ) { check ++; } if ( i % r == 0 ) { check ++; } if ( check == 1 ) { ct ++; } } cout << ct << endl ; } } This code is simple. There's no need for any explanation. Problem 5: Help Jarvis! Solution: (in c++) ( please gu