전체 글

    Android DarkTheme 도입기

    1. 서론 - Dagger2 구조 변경 - Jetpack Navigation - ViewModel 전면 도입 - 다크테마 도입 레퍼런스를 듣다보면, 다크테마에 대한 발표를 꽤나 들은 경험이 있습니다. 그리고 특히 최근에는 많은 앱에서 다크테마를 도입해서 좋은 UI/UX를 제공하는 사례가 많아졌고, '담다' 앱에도 도입해야겠다고 생각이 들었습니다. 그래서 다크테마를 도입하게 되었습니다. 작지만, 다크테마 도입을 하면서 누구나 쉽게 다크테마를 도입할 수 있다는 이야기를 해보려고 합니다. 2. 다크테마는 무엇인가? 우선, 다크테마는 developer에 이렇게 명시되어 있습니다. - 기기에 따라 전력량을 아낄 수 있습니다. - 가시성을 개선합니다. - 어두운 환경에서 쉽게 기기를 사용할 수 있습니다. 특히, 저..

    Leetcode[day18] - Minimum Path Sum

    Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. Input: [ [1,3,1], [1,5,1], [4,2,1] ] Output: 7 Explanation: Because the path 1→3→1→1→1 minimizes the sum. 1. 알고리즘을 해결하기 위해서 생각한 방법 - 최소값을 구해야하니, Math.min()을 활용해야 한다고 생각이 들었다. - 누적된 ..

    Leetcode[day17] - Number of Islands

    Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. Example 1: Input: 11110 11010 11000 00000 Output: 1 1. 알고리즘을 해결하기 위해서 생각한 방법 - 우선, 문제를 이해하는데 시간이 좀 걸렸다. - 해당 문제는 0이 물이고, 1이 땅이라고 할 때, 이어진 1이 ..

    Leetcode[day16] - Valid Parenthesis String

    Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the validity of a string by these rules: 1. Any left parenthesis '(' must have a corresponding right parenthesis ')'. 2. Any right parenthesis ')' must have a corresponding left parenthesis '('. 3. Left parenthesis '(' must go before the corresponding righ..

    Leetcode[day15] - Product of Array Except Self

    Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Constraint: It's guaranteed that the product of the elements of any prefix or suffix of the array (including the whole array) fits in a 32 bit integer. Note: Please solve it without division and in O(n). Follow up:Could you solve it with co..

    Leetcode[day14] - Perform String Shifts

    You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]: - direction can be 0 (for left shift) or 1 (for right shift). - amount is the amount by which string s is to be shifted. - A left shift by 1 means remove the first character of s and append it to the end. - Similarly, a right shift by 1 means remove the last character of s and..

    Leetcode[day13] - Contiguous Array

    Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Note: The length of the given binary array will not exceed 50,000. Input: [0,1] Output: 2 Explanation: [0, 1] is the longest contiguous subarray with equal number of 0 and 1. Input: [0,1,0] Output: 2 Explanation: [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1. 1...

    Leetcode[day12] - Last Stone Weight

    We have a collection of stones, each stone has a positive integer weight. Each turn, we choose the two heaviest stones and smash them together. Suppose the stones have weights x and y with x