__Nutella__'s blog

By __Nutella__, history, 3 years ago, In English

Ques.

Find the min. Number whose sum of digits is k and the number should be divisible by f. Since number can be large return output as string. Return -1 if no such number exist.

f < 500 k < 5000

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By __Nutella__, history, 3 years ago, In English

Given a string S consisting of characters 'r' and 'l' and N where N is length of road.

Determine the number of unique subsequences of those moves that lead from a given house x to end at another house y. Moves will be given as a sequence of l and r instructions where l indicates you need to move left and r indicates you need to move right. Return answer modulo 10^9+7

Input format- String (S) N — Length of road x — starting point y — Ending point

rrlrlr 6 1 2

Output- 7

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it