목록분류 전체보기 (83)
kohigowild

공 던지기 문제 설명 머쓱이는 친구들과 동그랗게 서서 공 던지기 게임을 하고 있습니다. 공은 1번부터 던지며 오른쪽으로 한 명을 건너뛰고 그다음 사람에게만 던질 수 있습니다. 친구들의 번호가 들어있는 정수 배열 numbers와 정수 K가 주어질 때, k번째로 공을 던지는 사람의 번호는 무엇인지 return 하도록 solution 함수를 완성해보세요. 제한사항 2

yarn add embla-carousel-react embla-carousel-react 패키지 설치 import { useEffect, useRef, useState } from 'react'; import { useEmblaCarousel } from 'embla-carousel-react'; function Carousel() { const [viewportRef, embla] = useEmblaCarousel({ loop: true }); const [cardInfo, setCardInfo] = useState([]); useEffect(() => { // 카드인포데이터패칭 }, []); return ( {cardInfo.map((card) => { return ( ); })} ); } expo..

숨어있는 숫자의 덧셈 (2) 문제 설명 문자열 my_string이 매개변수로 주어집니다. my_string은 소문자, 대문자, 자연수로만 구성되어있습니다. my_string안의 자연수들의 합을 return하도록 solution 함수를 완성해주세요. 제한사항 1 ≤ my_string의 길이 ≤ 1,000 1 ≤ my_string 안의 자연수 ≤ 1000 연속된 수는 하나의 숫자로 간주합니다. 000123과 같이 0이 선행하는 경우는 없습니다. 문자열에 자연수가 없는 경우 0을 return 해주세요. 나의 코드 function solution(my_string) { return my_string .split(/[^0-9]/g) .map(Number) .reduce((acc, cur) => { return (..

📡 REST Representational State Transfer - 자원 (Resource) : URI - 행위 (Verb) : HTTP Method - 표현 (Representations) : Server 응답 HTTP URI를 통해 자원을 명시하고 HTTP Method(POST, GET, PUT, DELETE)를 통해 해당 자원에 대한 CRUD Operation을 적용하는 것을 의미한다. 즉, REST는 자원 기반의 구조 설계의 중심에 Resource가 있고, HTTP Method를 통해 Resource를 처리하도록 설계된 아키텍처를 의미한다. 영화를 검색하는 사이트가 있다고 가정했을 때 /createMovie /seeMovie /getMovie/inception /deleteMovie/ince..

핸드폰 번호 가리기 문제 설명 프로그래머스 모바일은 개인정보 보호를 위해 고지서를 보낼 때 고객들의 전화번호의 일부를 가립니다.전화번호가 문자열 phone_number로 주어졌을 때, 전화번호의 뒷 4자리를 제외한 나머지 숫자를 전부 *으로 가린 문자열을 리턴하는 함수, solution을 완성해주세요. 제한 조건 phone_number는 길이 4 이상, 20이하인 문자열입니다. 나의 풀이 function solution(phone_number) { const LENGTH = phone_number.length; const x = phone_number.substr(0, LENGTH - 4).replace(/[0-9]/g, "*"); const y = phone_number.substr(x.length, ..

🚎 Overview 2023년 03월 12일 ~ 2023년 04월 08일 🌼 국내 여행 정보 · 후기 공유 플랫폼 Notion https://trustmitt.notion.site/wheregram-1d19d37a91224cdbacf4536c15dae1a7 #wheregram 국내 여행 정보 · 후기 공유 플랫폼 trustmitt.notion.site Github https://github.com/trustmitt/wheregram GitHub - trustmitt/wheregram: 국내 여행 정보 · 후기 공유 플랫폼 ⛺ 국내 여행 정보 · 후기 공유 플랫폼 ⛺. Contribute to trustmitt/wheregram development by creating an account on GitHu..

🌼 페이지 진입 시 불러올 첫 번째 쿼리문 작성 export const getExploreDoc = async (setKey: any) => { const fristQ = query(collection(db, 'feed'), orderBy('createAt', 'desc'), limit(4)); const querySnapshot = await getDocs(fristQ); const data = querySnapshot.docs.map((doc) => ({ ...doc.data(), })); setKey(querySnapshot.docs[querySnapshot.docs.length - 1]); return data; }; limit : 4개의 게시물을 불러온다. 불러온 데이터 중 가장 마지막 값을 s..

🌼 현재 파이어스토어에서는 전체 텍스트 검색을 지원하지 않는다. 파이어베이스를 사용하면서 검색을 구현하기 위해서는 쿼리문을 변형해서 사용하거나 타사 솔루션인 Algolia나 Elastic 같은 검색 엔진 API를 사용해야 한다. 파이어베이스에서 제공하는 기능으로만 키워드 검색을 구현하기 위해 쿼리문을 사용해 보자. 🗒️ 기존 코드의 문제점 const q = query(collection(db, 'feed'), where('address', '>=', keyword), where('address', '