TORONTO KIDS COMPUTER CLUB | Blog
1815
paged,page-template,page-template-blog-large-image,page-template-blog-large-image-php,page,page-id-1815,paged-181,page-paged-181,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Blog

23 Mar PMCA Sunday 10:00 Practice -03.21

Use Stack to solve the following question: You are given an array A of Q integers and Q queries. In each query, you are given an integer i (1≤i≤N). Your task is to find the minimum index greater than i (1≤i≤N) such that: Sum of digits of Ai is greater than the sum of digits of Aj Ai < Aj If there is no answer, then print -1. Input...

Read More