Two Pointer Algorithm Python Code For Rock