Input 8 6 45 39 40 28 44 9 38 30 62 31 60 49 63 42 61 20 26 47 27 16 17 29 37 1 64 11 6 2 32 13 55 3 36 41 46 34 5 54 19 21 56 57 24 43 58 53 12 59 10 8 52 51 35 4 50 18 22 7 23 15 48 25 33 14 Expected Output MMMMGGGG MMMMMGGG MMMMMGGG MMMMGGGG GMMGGGGG GGGGGGGG GGGGGGGG GGGGGGGGUpdate Logs
Note: You can also use F5 to update the logs. This would also retain cursor position while scrolling.