a frog crossing river the river divide number unit unit exist stone the frog jump stone jump waterGiven list stone position unit sort ascending order determine frog cross river landing stone initially frog stone assume jump 1 unitIf frog jump k unit jump k 1 k k 1 unit the frog jump forward direction example 1input stone 0135681217output trueexplanation the frog jump stone jump 1 unit 2nd stone 2 unit 3rd stone 2 unit 4th stone 3 unit 6th stone 4 unit 7th stone 5 unit 8th stoneexample 2input stone 012348911output falseexplanation there way jump stone gap 5th 6th stone large constraints2 stoneslength 20000 stonesi 231 1stones0 0stone sort strictly increase order