Posts

Showing posts with the label discrete-mathematics

find the exact positions of n numbers, if each time only 3 positions individually known are in order

Image
Clash Royale CLAN TAG #URR8PPP find the exact positions of n numbers, if each time only 3 positions individually known are in order Say if there an array of length N. We need to find the exact positions of M unique numbers in N positions. example: The array of length 19 contains 8 unique numbers was in order like 3|6|1|8|1|2|9|8|6|3|5|1|8|7|1|9|8|7|1 The ARRAY given in top we don't know. We have set with 3 numbers each like below 3|6|1 2|9|8 6|1|8 9|8|7 1|8|7 1|8|7 6|3|5 8|7|1 3|5|1 8|6|3 1|8|1 5|1|8 9|8|6 8|7|1 7|1|9 1|2|9 1|9|8 8|1|2 1|3|6 7|1|3 Can we backtrack to form the above array with exact positions by using the above set of 3 numbers each at a time. I tried multiple ways to find the logic but unluckily didn't achieve the exact array given :( Need the logic in pseudo code or program in any language NOTE:- This is a circular thing--- like a circular queue created with array Although not strictly required, it's good pra...