1. simple way using destructuring const AdminProductDetail = () => { const params = useParams(); const navigate = useNavigate(); const [product, setProduct] = useState({ name: '', price: 0, image: '', brand: '', category: '', countInStock: 0, description: '', }); const getData = async (id) => { try { const { data } = await axios.get(`/api/products/${id}`); const { name, price, image, brand, cate..
중복된 값 string return. function FindIntersection(strArr){ let first = strArr[0].split(','); // turn them into array let second = strArr[1].split(','); //중복되는 value 찾기. let filtered = first.filter(function (value){ return second.includes(value) //case-sensitive. return true if it contains the value. }) //중복없으면 return false. if(filtered.length === 0){ return false; }else{ //array to string using joi..
function twoSum(numArr, target) { //Create new Map const numMap = new Map(); //Loop with index for (const [index, element] of numArr.entries()) { //array iterator that returns key/value for each index. //need to calculate the difference so we can compare with array elements const diff = target - element //If our numMap can find the current element which matches the diff, return the array if (num..
git status //check the git status git pull origin 'branch이름' git checkout -b "branch name" // with '-b', you can create a new branch and checkout at the same time git add . git commit -m "message" git push origin 'branch이름' git checkout master git pull
문제. original price에서 1개 이상을 살때마다 그 다음 product는 sale에 해당되는 할인가를 계속 적용한다. 그 할인된 가격이 limit과 같아지면 할인을 멈추고 총 budget 만큼 합계가 되면 총 몇개의 게임을 샀는지 total game count 를 return 한다. let original = 20; let sale = 3; let limit = 6; let budget = 80; function Sales(o,s,l,b){ let total = o; //여기서 시작이라서. let count = 0; while(total
- Total
- Today
- Yesterday
- hackerrank
- java
- spring boot application
- 프로그래머스
- Object type casting
- math.max
- rest parameter
- 프로그래머스 알고리즘문제
- HashMap
- code refactoring
- equals()
- ... in Javascript
- hackerrank javascript solution
- Javascript Algorithm
- javascript
- HackerRank Algorithm
- string class in java
- math.abs
- algorithm
- 알고리즘
- easy javascript algorithm
- substring()
- C++
- hackerrank solution
- easy algorithm
- 프로그래머스 알고리즘
- repeat()
- Collection Framework
- compareTo()
- hackerrank javascript
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |