This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def solution(a, b): | |
aBigNum, bBigNum = str(a), str(b) | |
maxLen = max(len(aBigNum), len(bBigNum)) | |
aChar = attachZero(aBigNum, maxLen) | |
bChar = attachZero(bBigNum, maxLen) | |
answer = addBigNum(aChar, bChar) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func Append(slice, data []byte) []byte { | |
l := len(slice) | |
if l+len(data) > cap(slice) { // 재할당 여부 체크 | |
// 두배의 크기로 할당 | |
newSlice := make([]byte, (l+len(data))*2) | |
// 내장함수 copy를 사용해 복사 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type counter int | |
func (r counter) inc(v int) int { | |
return int(r) + v | |
} |