본문 바로가기
반응형

전체 글192

[flutter] Copying a list (deep copy) (리스트를 복사하기(깊은 복사)) [flutter] Copying a list (deep copy) (리스트를 복사하기(깊은 복사)) List.from을 이용해서 복사하면 깊은 복사가 이루어진다. [English](Copying using List.from makes a deep copy.) this.reviews = List.from(reviews); https://stackoverflow.com/questions/63091889/flutter-firebase-get-array-from-firestore-and-assign-it-to-a-list flutter firebase get array from Firestore and assign it to a list I have a collection in Firestore. It has .. 2021. 11. 1.
BOJ 12851 - 숨바꼭질 2 https://www.acmicpc.net/problem/12851 12851번: 숨바꼭질 2 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 때 www.acmicpc.net 문제 설명 숨바꼭질 2 문제 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 때 걷는다면 1초 후에 X-1 또는 X+1로 이동하게 된다. 순간이동을 하는 경우에는 1초 후에 2*X의 위치.. 2021. 10. 31.
[flutter] How to adjust the height of the Grid View widget(그리드 뷰 위젯 높이 조절하는 방법) [flutter]How to adjust the height of the Grid View widget(그리드 뷰 위젯 높이 조절하는 방법)GridView.count의 childAspectRatio를 설정하면 된다. (Set the childAspectRatio of GridView.count.)Widget build(BuildContext context) {    var size = MediaQuery.of(context).size;    final double itemHeight = (size.height - kToolbarHeight - 24) / 2;    final double itemWidth = size.width / 2;    return new Scaffold(      appBar: n.. 2021. 10. 31.
[LeetCode.412][easy] Fizz Buzz https://leetcode.com/problems/fizz-buzz/ Fizz Buzz - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 접근 방법 1부터 n까지에 대해 3과5의 공배수인지, 3의 배수인지, 5의 배수인지 체크한다. O(n)의 시간복잡도를 차지하는 알고리즘으로 풀었다. 풀이 코드 class Solution { public: vector fizzBuzz(int n) { vector ans; for(int i=1;i 2021. 10. 30.
반응형