This file contains 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 time | |
from textwrap import wrap | |
import matplotlib.pylab as plt | |
import numpy as np | |
import tensorflow as tf | |
import tensorflow_datasets as tfds | |
import ssl | |
ssl._create_default_https_context = ssl._create_unverified_context |
This file contains 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
func checkZeroOnes(s string) bool { | |
oneLen := getLongest(s, "1") | |
zeroLen := getLongest(s, "0") | |
if oneLen > zeroLen { | |
return true | |
} | |
return false |
This file contains 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" | |
"math" | |
) | |
func main() { | |
fmt.Println(abs(-5)) | |
} |
This file contains 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
db | |
.myCollection1 | |
.aggregate([ | |
{ | |
"$match": { | |
"status": true | |
} | |
}, | |
// case1 |
This file contains 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
db | |
.myCollection1 | |
.aggregate([ | |
{ | |
"$match": { | |
//이렇게 미리 match를 통해 myCollection1에서 가져올 부분을 명확히 함 | |
"status": true | |
} | |
}, |
This file contains 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
func isPalindrome(head *ListNode) bool { | |
//돌면서 다 담아주고 | |
tmpArr := make([]int, 0) | |
for head != nil { | |
tmpArr = append(tmpArr, head.Val) | |
head = head.Next | |
} | |
// 1/2만 돌면서 비교하면 됨 |
This file contains 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
func mergeTwoLists(l1 *ListNode, l2 *ListNode) *ListNode { | |
if l1 == nil { | |
return l2 | |
} | |
if l2 == nil { | |
return l1 | |
} |
This file contains 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
func reverseList(head *ListNode) *ListNode { | |
head = &ListNode{Next:head} | |
cur, curN := head, head | |
tmpArr := make([]int, 0); | |
for { | |
cur = cur.Next | |
if cur == nil { | |
break; |
This file contains 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
func removeNthFromEnd(head *ListNode, n int) *ListNode { | |
head = &ListNode{Next: head} | |
cur, curN := head, head | |
//head.Next == cur.Next => true | |
//cur.Next == curN.Next => true | |
for i := 0; cur != nil; i++ { | |
curN = curN.Next | |
cur = cur.Next |
This file contains 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
func deleteNode(node *ListNode) { | |
*node = *node.Next | |
} |
NewerOlder