All posts by igorperic
Leetcode 39 – Combination Sum
Source: https://leetcode.com/problems/combination-sum/ Problem statement Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen from candidates an unlimited number of times. Two combinations…
Leetcode 30 – Substring with concatenation of all words
Source: https://leetcode.com/problems/substring-with-concatenation-of-all-words/ Problem statement You are given a string s and an array of strings words. All the strings of words are of the same length. A concatenated substring in s is a substring that contains all the strings of any permutation of words concatenated. For example, if words = [“ab”,”cd”,”ef”], then “abcdef”, “abefcd”, “cdabef”,…

7 soft skills to accelerate your career
Working with people is hard, mostly thanks to the complex and unpredictable nature of human emotions. Inarticulate factors frequently jump in, subconsciously affecting every thought and decision we make. To scratch the surface of proving my point, the header image should remind you of a very well known doodle you’ve probably stumbled upon on the…
Educational Codeforces Round 129 – Problem C
You are given two arrays a and b, both consisting of n integers. In one move, you can choose two indices i and j (1≤i,j≤n; i≠j) and swap ai with aj and bi with bj. You have to perform the swap in both arrays. You are allowed to perform at most 104 moves (possibly, zero)….

Educational Codeforces Round 129 – Problem B
Monocarp has just learned a new card trick, and can’t wait to present it to you. He shows you the entire deck of n cards. You see that the values of cards from the topmost to the bottommost are integers a1,a2,…,an, and all values are different. Then he asks you to shuffle the deck m…

Educational Codeforces Round 129 – Problem A
Alice and Bob play a game. Alice has n cards, the i-th of them has the integer ai written on it. Bob has m cards, the j-th of them has the integer bj written on it. On the first turn of the game, the first player chooses one of his/her cards and puts it on…

Codeforces Round #793 – Problem C
C. LIS or Reverse LIS? time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output You are given an array a of n positive integers. Let LIS(a) denote the length of longest strictly increasing subsequence of a. For example, LIS([2,1,1,3]) = 2. LIS([3,5,10,20]) = 4. LIS([3,1,2,4]) =…

Codeforces Round #793 – Problem B
B. AND Sorting time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output You are given a permutation p of integers from 0 to n−1 (each of them occurs exactly once). Initially, the permutation is not sorted (that is, pi>pi+1 for at least one 1≤i≤n−1). The permutation…

Codeforces Round #793 – Problem A
A. Palindromic Indices time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output You are given a palindromic string s of length n. You have to count the number of indices i (1≤i≤n) such that the string after removing si from s still remains a palindrome. For…

Explainable AI – what is it and why should you care?
In most of the cases each model is observed as a black box – data goes in, prediction goes out. The intrinsic details of processing are initially reserved for machine learning researchers in academic circles. Even they don’t know what exactly did the network learn, they can only propose the model architectures and training methods…