Problem statement Jack is playing a 2D game. In that, there are N towers aligned in a straight horizontal line from left to right. Jack has to move from right to left by jumping. He can jump over K towers provided they all are shorter than or equal to the current tower. Find the value of K for each tower. Input First line contains an integer T specifying the number of test cases. Second line contains an integer N specifying the number of towers. Third line contains n space separated integers(H[i]) denoting the height of each tower. Output Print the value K for each tower separated by a space. Explanation: For 7th term there are 5 tower smaller than itself. Similarly for 6th there are 3 towers. Constraint 1 <= T <= 10 2 <= n <= 10^6 1 <= H[i] <= 10^8
-
Notifications
You must be signed in to change notification settings - Fork 0
dbrn/towerjump
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published