Category: Tech, Hardware & Audio

  • 66. Plus One LeetCode Solution in Python

    66. Plus One LeetCode Solution in Python

    Plus One LeetCode Solution in Python 3. Given a non empty array of decimal digits representing a non-begative integer.Increment the integer, most significant digit is on the left. Each element contains a single digit.No leading zeros except for the number 0. Examples Input: digits = [1,2,3] Output: [1,2,4] Input array represents the int 123 +…

  • Google Interview 686. Repeated String Match

    Google Interview 686. Repeated String Match

    Google Interview 686. Repeated String Match. Given two strings a and b, return the minimum number of times you should repeat string a so that string b becomes a subscring of sring a.If b cannot be a substring of a after repeating it, return -1. String “acb” repeated 0 times is “”, repeated 1 times…

  • Google 844. Backspace String Compare

    Google 844. Backspace String Compare

    Google Interview 844. Backspace String Compare Given two strings s and t, return True if they are equal. ‘#’ means backspace. Examples Input: s = “ab#c”, t = “ad#c” Output: true Explanation: Both s and t become “ac”. Input: s = “abb#c”, t = “ade#c” Output: false Explanation: s becomes “abc” and t becomes “adc”.…

  • Two Sum Solution [LeetCode 1]

    Two Sum Solution [LeetCode 1]

    Two Sum Solution in Python 3 [LeetCode 1] Given an array of integers nums and a target integer. Return the indexes (not values) of the 2 numbers that add up to the target value. One solution and one element can’t be used twice. Example nums = [1,2,8,7,11,15], target = 13 output= [1,4], indexes start at…

  • LeetCode 482 License Key Formatting Solution

    LeetCode 482 License Key Formatting Solution

    LeetCode 482 License Key Formatting Solution in Python 3. LeetCode 482 Solution 32 ms in Python 3 You are given a license key represented by the string s that contains only alphanumeric characters and dashes. You are also given an integer k. Reformat the string s so that each group contains exactly k characters, except…

  • How to reverse a string in Python 3

    How to reverse a string in Python 3

    To reverse a string in Python the bellow are the best ways so far: Write [::-1] to do slicing in Python starting at first character, until last, step by 1 in reverse (-1). It’s a pretty nice way to impress your imaginary friends. Option 1 Option 2 Whole code demo Write a comment or no,…

  • How to reverse integer in Python 3

    How to reverse an integer in Python 3. In Python 3 int type is the same as long so there is no need to check for int overflow. In other cases you will have to check for integer max value and min value to avoid a stack overflow. The steps are bellow with each testing…

  • Find the missing number in an array

    Find the missing number in an array

    Computer science job interview question:Find the missing number in the series.Write a program to calculate the missing number in the series of integers. There are multiple ways to do this bu using the Gauss Sum addition method is a nice trick and it’s faster than any brute-force iteration you might think of.More info https://en.wikipedia.org/wiki/Gauss_sum The…

  • How to take a screenshot on Android MIUi Xiaomi

    How to take a screenshot on Android MIUi Xiaomi

    There are 3 ways to screenshot on a Xiaomi MIUI 12 smartphone or tablet. 1. Swipe down to show the top menu then press on Screenshot.this will take a screenshot and save it for you.2. Press the power button + Volume down button simultaneously. a screenshot is taken in the same way and tou have…

  • Rocky Linux vs Centos vs Oracle Linux

    Rocky Linux vs Centos vs Oracle Linux

    Since Centos 8 and Centos Stream came out, I’ve been looking for an alternative Linux operating system for our small web-server. The OS could be Debian based but I would prefer it if it’s RHEL based since I’m used to that. What to choose between Rocky Linux vs Oracle vs RHEL vs Centos Stream now.…