https://ide.codingblocks.com/s/295949 Here is the Code
Getting Segmentation fault
You code is giving wrong output for the given sample test case.
Refer this https://ide.codingblocks.com/s/280601
You can verify your approach from this video
You code is giving wrong output for the given sample test case.
Refer this https://ide.codingblocks.com/s/280601
You can verify your approach from this video