
1769. Minimum Number of Operations to Move All Balls to Each Box
·
Algorithm
Minimum Number of Operations to Move All Balls to Each Box - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1과 0으로 이루어진 문자열이 주어진다. 특정 index로 문자열의 모든 1을 이동시켰을 때의 비용 값을 반환하는 문제다. 한 칸 움직이는 비용은 1이다. Input: boxes = "001011" Output: [11,8,5,4,3,4] 0번 인덱스로 모든 1을 옮기려면 2,4,5번 인덱스의 1을 0번 인덱..