FARMAAN_KHANN's blog

By FARMAAN_KHANN, history, 7 months ago, In English

write a program that:

  1. reads provided inputs containing alphabetically sorted words list (one word per line, no spaces, all lower case)
  2. output the following things
 2.1  longest compounded word

2.2 second longest compounded word

NOTE :: a compounded word is one that can be constructed by combining (concatenating) shorter words also found in the same test-case input file :: small word list, consisting following words

cat 
 cats
 catsdogcats
 catxdogcatsrat
 dog
 dogcatsdog
 hippopotamuses
 rat 
 ratcatdogcat

ANSWERS:: longest compounded word :: ratcatdogcat second longest compounded word :: catsdogcats constraint 1<=N<=10^8

please provide me the solutions and time complexity with explanation i hope all off you reply this question comes in GOOGLE in open book assignment conducted in IIT mandi love you all

Full text and comments »

  • Vote: I like it
  • -43
  • Vote: I do not like it

By FARMAAN_KHANN, history, 9 months ago, In English

on 15 august in INDIA we celebrate independence day you please change the date for round 893 or it will worthless coz no indian will participate in that round

Full text and comments »

  • Vote: I like it
  • -41
  • Vote: I do not like it

By FARMAAN_KHANN, history, 15 months ago, In English
#include <iostream>
using namespace std;
bool solve1(long long small,long long  big){
  int s=0;
  while(small>0){
    s+=small%10;
    small/=10;
  }
  int k = 0;
  while(big>0){
    k+=big%10;
    big/=10;
  }
  // cout<<s<<" "<<k<<'\n';
  if(s==k){
    return true;
  }else return false;
}
void solve(){
  long long  n; cin>>n;
  for(long long  i=1;i<n;i++){
    cout<<i<<'\n';
    if(solve1(i,n-i)){
      // cout<<'\n';
      cout<<i<<" "<<n-i<<'\n';
      return;
    }
  }
}
int main() 
{
    int t; cin>>t;
    while(t--){
      solve();
    }
}

Full text and comments »

  • Vote: I like it
  • -7
  • Vote: I do not like it

By FARMAAN_KHANN, history, 17 months ago, In English

I am new here please tell me what does that mean user is diabled by administrators does that mean ban or something else.

Full text and comments »

  • Vote: I like it
  • -6
  • Vote: I do not like it