strange14's blog

By strange14, history, 3 years ago, In English

The problem is 1557B - Moamen и k-подотрезки. Here is my submission : 135732613

I am using two pointers to greedily count the already sorted sub-arrays of maximum length, and checking if it's less than k, in which case it should return YES otherwise NO.

Also, just wanted to express my gratitude for this platform where you people never hesitate to help noobs like me!

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

»
3 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

Counter test:

1

5 2

1 2 4 3 5

answer: no