Sign in to Publish article.

Sign in

Rajan Kumar

Rajan Kumar published an article

4 days, 15 hours ago

Algorithms and Maths you need to know for hard level competitive programming problems

Several programmers solve a lot of problems of easy level and medium level but they fail to solve hard level problems. Reason is, Hard level problems in competitive programming requires a deep understanding of mathematics and algorithms. Here are a topics you need to know to solve Hard level competitive programming problems.

  • Data structures: Maps, Segment tree, Fenwick tree, Heaps …
Read full article

arrow_upward Upvote 44

comment Comment

arrow_downward downvote


Rajan Kumar

Rajan Kumar published an article

1 week, 2 days ago

C++ Hacks for Competitive programming

There are lot of C++ Hacks you can use to save time in competitive programming. Here are few of them.

  • Getting rid of “includes”: Just use
    #include <bits/stdc++.h>
  • Useful inbuilt functions:
    • __gcd(a, b): Returns the GCD of a and b
    • __builtin_popcount(x) : Returns the number of set bits in x
  • Initializer Lists: These make STL containers easy to initialize, for …
Read full article

arrow_upward Upvote 43

comment Comment

arrow_downward downvote


Vishal Saxena

Vishal Saxena published an article

2 weeks, 3 days ago

Find maximum xor of k elements in an array

Given an array arr[] of N integers and an integer K. The task is to find the maximum xor subset of size K of the given array.

Lets take a look at an example.

Input

arr[] = {2, 5, 4, 1, 3, 7, 6, 8}, K = 3

Output

15

Explanation

We can get 15 by selecting 4, 5, 6, 8

Naive approach …

Read full article

arrow_upward Upvote 42

comment Comment

arrow_downward downvote


Harsh Shukla

Harsh Shukla published an article

2 weeks, 3 days ago

Minimum steps to reach end of array under constraints

Given an array of one digit numbers. Your task is to find out the minimum number of steps that is needed to reach the end of the array when you are at the first index of the array in the begining. In one steps, you can jump to the neighbor indices or you can jump to the position whose value is same as the …

Read full article

arrow_upward Upvote 41

comment Comment

arrow_downward downvote


Rajan Kumar

Rajan Kumar published an article

2 weeks, 5 days ago

Add two numbers without using arithmetic operators

We want to add 2 numbers without using arithmetic operator ( + , - , / , * ) . The trick here is to use properties of XOR. 

So, let's try to understand how it works.

We'll use Half adder logic here. Points to note down are:

  • Sum of two bits can be obtained by performing XOR (^) of the two bits.
  • Carry bit can be obtained by performing …
Read full article

arrow_upward Upvote 40

comment Comment

arrow_downward downvote


Rajan Kumar

Rajan Kumar published an article

3 weeks, 1 day ago

Efficient Method to Check if a Number is Multiple of 3

We are given a number and we want to check if the number is Multiple of 3 or not. The very simple first solution comes in our mind is old school way. We can check if a number is multiple of 3 or not by adding all the digits of number. If the total sum of digits is multiple of …

Read full article

arrow_upward Upvote 39

comment Comment

arrow_downward downvote


Rajan Kumar

Rajan Kumar published an article

3 weeks, 1 day ago

DNA to Protein Converter using Python 3 and Django 2.1

DNA is present in every cell of human being. Informations gathered from DNA can be very usefule in crime investigations, health care and medicine industries.

Here, i have explained how can we produce protin structure from any given DNA sample. Let me give you a quick information about how does DNA sample will look like which we are going to …

Read full article

arrow_upward Upvote 38

comment Comment

arrow_downward downvote


Rajan Kumar

Rajan Kumar published an article

3 weeks, 3 days ago

Step by step guide to improve competitive programming skills

Competitive programming is art of understanding and problem solving. Machine Learning or Blockchain might be the next big thing, but competitive programming problem-solving is the skill of the decade. It requires sharp analytical skill and expertise coding language too.

There are a lot of programmers out there, stuck on a stage where they are able to solve basic problems and ad-hoc problem …

Read full article

arrow_upward Upvote 37

comment Comment

arrow_downward downvote


Rajan Kumar

Rajan Kumar published an article

3 weeks, 6 days ago

Implement a Dictionary using Trie

In this article I'll implement a dictionary using Trie Data Structure. We'll discusss implementation of a dictionary using Trie (memory optimization using hash-map).

Let's take a problem and that requires dictionary to solve, this way we'll understand the in better way.

 

Problem

There are some name of students and we have their corresponding marks. Now the problem is to …

Read full article

arrow_upward Upvote 36

comment Comment

arrow_downward downvote


Rajan Kumar

Rajan Kumar published an article

1 month ago

Range Trees

Range Trees are order data structures. They hold a list of points or nodes. They are used to answer queries about something in a certain range of any given graph or list.

Suppose, there is an array and you want to find out the Kth smallest element in a subarray of the given array. Here you'll be using Range trees.

Read full article

arrow_upward Upvote 35

comment Comment

arrow_downward downvote



View more

HackersFriend Updates


update Aug. 15, 2019, 1:47 p.m.

Full view page of article has been changed to match style of homepage feed. open_in_new


update Aug. 14, 2019, 12:52 a.m.

Total number posts on homepage is incresed to 10 by default and text-decoration of link to post and author is changed. open_in_new


update Aug. 7, 2019, 1:51 a.m.

We changed our homepage. Now, you can see newly published articles, directly on home page. open_in_new


View more


Events


event Nov. 28, 2018, 5:30 p.m.

Python from zero to hero

place Delhi

View details



event Aug. 13, 2018, 5:30 p.m.

Python from zero to hero

place Bangalore ( HackersFriend office BTM Layout)

View details