C++ ] leetCode 64 - Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. Example 1: Input: grid = [[1,3,1],[1,5,1],[4,2,1]] Output: 7 Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum. Example 2: Input: grid = [[1,2,3],[4,5,6]] Output: 1..
2023. 3. 31.
MFC ] stringstream 사용하여 문자열 파싱하기
예제코드 CString result; string str = CT2CA(result); istringstream ss(str); string line; int i = 0; while(getline(ss, line, '\n')) { istringstream linestream(line); string cell; getline(linestream, cell, ','); m_list.InsertItem(i, cell.c_str()); int j = 0; while (getline(linestream, cell, ',')) { m_list.SetItem(i, j, LVIF_TEXT, cell.c_str(), NULL, NULL, NULL, NULL); j++; } i++; } '\n' 와 ',' 로 구분하는 형..
2022. 7. 14.