Skip to content

Instantly share code, notes, and snippets.

View mumunuu's full-sized avatar

무무 mumunuu

  • Seoul, South Korea
  • 05:52 (UTC +09:00)
View GitHub Profile
@mumunuu
mumunuu / test.py
Last active September 18, 2023 05:35
Create Image Captioning Models
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
@mumunuu
mumunuu / long.go
Created June 8, 2021 02:48
1869. Longer Contiguous Segments of Ones than Zeros
func checkZeroOnes(s string) bool {
oneLen := getLongest(s, "1")
zeroLen := getLongest(s, "0")
if oneLen > zeroLen {
return true
}
return false
@mumunuu
mumunuu / myFunction.go
Last active March 26, 2021 14:44
ultimate go 노션에 해당하는 모든 함수들 입니다.
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(abs(-5))
}
@mumunuu
mumunuu / pagination.js
Last active March 16, 2021 13:54
mongodb-pagination-2
db
.myCollection1
.aggregate([
{
"$match": {
"status": true
}
},
// case1
@mumunuu
mumunuu / matchBeforeLookup.js
Last active March 16, 2021 13:35
mongodb-pagionation-1
db
.myCollection1
.aggregate([
{
"$match": {
//이렇게 미리 match를 통해 myCollection1에서 가져올 부분을 명확히 함
"status": true
}
},
@mumunuu
mumunuu / isPalindrome.go
Created February 28, 2021 16:55
algorithm(leetcode) Palindrome Linked List
func isPalindrome(head *ListNode) bool {
//돌면서 다 담아주고
tmpArr := make([]int, 0)
for head != nil {
tmpArr = append(tmpArr, head.Val)
head = head.Next
}
// 1/2만 돌면서 비교하면 됨
@mumunuu
mumunuu / mergeTwoLists.go
Last active February 28, 2021 16:46
algorithm(leetcode) Merge Two Sorted Lists
func mergeTwoLists(l1 *ListNode, l2 *ListNode) *ListNode {
if l1 == nil {
return l2
}
if l2 == nil {
return l1
}
@mumunuu
mumunuu / reverseLinkedList.go
Last active February 28, 2021 15:00
algorithm(leetcode) Reverse Linked List
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;
@mumunuu
mumunuu / removeNthNode.go
Created February 28, 2021 14:01
algorithm(leetcode) Remove Nth Node From End of List
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
@mumunuu
mumunuu / deleteNodeLinkedList.go
Created February 28, 2021 12:29
algorithm(leetcode) Delete Node in a Linked List
func deleteNode(node *ListNode) {
*node = *node.Next
}