Enlightenment

Enlightenment of the Day 21.02.13

Koowoy
Handling Edge Cases in Image Filtering / Understanding Rounding of Floats in C 1. Handling Edge Cases in Image Filtering Problem Using C, create a program that apllies different filters on images. Each pixel is stored in a two dimensional array. Obsctacle When filtering the image with ‘blur’ and ‘border’ filter, for each pixel in the image, certain values of all surrounding pixels needs to be reached. However, the number of surrounding pixels vary depending on the location of the pixel, more precisely, depending on whether the pixel is in the corner, edge or the middle.

Enlightenment of the Day 21.02.01

Koowoy
Sorting and Locking Pairs for Tideman (CS50 Problem Set 3) The Original Problem Explained (Tideman) The Problem Encountered Although with the test sets provided with the example seemed to work just fine with the code I originally wrote, when graded, it showed that my code didn’t lock the pairs correctly (meaning it didn’t lock what it was supposed to, and locked pairs where it should have skipped). 1. Sorting Problem Instructions

Enlightenment of the Day 21.01.21

Koowoy
Getting Student with Highest Score Problem 3 Students are taking a multiple choice test with 5 answer options. Without actually solving the problem, they repeat the same pattern of numbers. When fed with the answer array, return the student who scored the highest. Requirements 1. The pattern of each student is as follows: Student 1: 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2 .... Student 2: 2, 1, 2, 3, 2, 4, 2, 5, 2, 1, 2, 3 .

Enlightenment of the Day 21.01.11

Koowoy
Situation Solving the following task on Programmers (Link) Task An interger array ‘numbers’ is given. Create a function that returns an array consisting of sums of 2 numbers of different index sorted in an ascending order. Resitrictions The length of ‘numbers’ is between 2 to 100. All of the numbers of are bewtween 0 to 100. Input/Output example numbers result [2, 1, 3, 4, 1] [2, 3, 4, 5, 6, 7] [5, 0, 2, 7] [2, 5, 7, 9, 12] My Approach to the Solution Initially Logic Sort the input array in ascending order => loop through the array using forEach => in each iteration, map the array, adding the current value to the array => add all that to a result array => using Set, pick out unique values