초보코딩 4

LeetCode - 1672. Richest Customer Wealth

You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has. A customer's wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth. problem Example 1: Input: accounts = [[1,2,3]..

초보코딩 2021.08.06

LeetCode - 1920. Build Array from Permutation

Problem Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 List[int]: ans = [] for i in range(len(nums)): ans.append(nums[nums[i]]) return ans 내 생애 처음 풀어 본 리드코드 문제 결국은 해결책을 보고 이해를 했다. ans = []는 배열을 지정했다. for in range는 반복문이고, len(nums)는 어떻게 반복 할 것인가에 대한 조건이다. len은 길이다. Example 1에 보면 숫자가 6개가 있다. 그렇다 이 for in range는 6번 반복 될..

초보코딩 2021.08.04