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
const { ApolloServer, gql } = require('apollo-server'); | |
const typeDefs = gql` | |
type Query { | |
ping: String | |
} | |
`; | |
const resolvers = { | |
Query: { |
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
findUser(1) | |
.then(function(user) { | |
console.log("user:", user); | |
}); | |
function findUser(id) { | |
return new Promise(function (resolve) { | |
setTimeout(function() { | |
console.log("waited 0.1 sec."); | |
const user = { |
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
function findUser(id) { | |
let user; | |
setTimeout(function() { | |
console.log("waited 0.1 sec."); | |
user = { | |
id: id, | |
name: "User" + id, | |
email: id + "@test.com" | |
}; | |
}, 100); |
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
class Solution(object): | |
def findSubstringInWraproundString(self, p): | |
dic = {} | |
for i, v in enumerate(p): | |
if i > 0 and ((ord(p[i]) - ord(p[i - 1])) % 26) == 1: | |
subs += 1 | |
else: | |
subs = 1 | |
dic[v] = max(subs, dic.get(v, 0)) | |
return sum(dic.values()) |
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
// 배열의 원소에 개별 접근하기 | |
var fruit1 = fruits[0]; | |
var fruit2 = fruits[1]; | |
var fruit3 = fruits[2]; | |
var fruit3 = fruits[3]; // undefined |
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
""" | |
https://www.acmicpc.net/problem/2662 | |
""" | |
def maximize(total, cnt, table): | |
dp = [[0] * (cnt + 1) for _ in range(total + 1)] | |
investments = [[0] * (cnt + 1) for _ in range(total + 1)] | |
for company in range(1, cnt + 1): |
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
test |