# Category Archives: School Programming

## Print all proper fractions with denominators less than equal to N

Given an integer N, the task is to print all proper fractions such that the denominator is less than or equal to N.   Proper Fractions:… Read More »

## Count of unique digits in a given number N

Given a number N, the task is to count the number of unique digits in the given number. Examples: Input: N = 22342 Output: 2 Explanation:The digits… Read More »

## Maximum number of objects that can be created as per given conditions

Given N items of type-1 and M items of type-2. An object can be created from 2 items of type-1 and 1 item of type-2… Read More »

## Min operations to reduce N by multiplying by any number or taking square root

Given a number N, the task is to find the minimum value of N by applying below operations any number of times:  Multiply N by… Read More »

## Check if frequency of each element in given array is unique or not

Given an array arr[] of N positive integers where the integers are in the range from 1 to N, the task is to check whether… Read More »

## Check if an N-sided Polygon is possible from N given angles

Given an array arr[] of N elements, where each element represents an angle(in degrees) of a polygon, the task is to check whether it is… Read More »

## Print all numbers in given range having digits in strictly increasing order

Given two postive integers L and R, the task is to print the numbers in the range [L, R] which have their digits in strictly… Read More »

## How to create a Heart using C Graphics

Prerequisite: graphics.h, How to include graphics.h? The task is to write a C program to draw a Heart using graphics in C. Approach: To run… Read More »

## Minimum cost to convert given string to consist of only vowels

Given string str of lower case alphabets, the task is to find the minimum cost to change the input string in a string that contains… Read More »

## Printing triangle star pattern using a single loop

Given a number N, the task is to print the star pattern in single loop. Examples:  Input: N = 9 Output: * * * *… Read More »

## How to remove all non-alphanumeric characters from a string in Java

Given a string str, the task is to remove all non-alphanumeric characters from it and print the modified it. Examples:  Input: @!Geeks-for’Geeks,123 Output: GeeksforGeeks123 Explanation: at symbol(@), exclamation… Read More »

## Find indices of all local maxima and local minima in an Array

Given an array arr[] of integers. The task is to find the indices of all local minima and local maxima in the given array.Examples: Input:… Read More »

## Minimum steps to convert X to Y by repeated division and multiplication

Given two integer X and Y, the task is to find the minimum number of steps to convert integer X to Y using any of… Read More »

## Check if a given string is Even-Odd Palindrome or not

Given a string str, the task is to check if the given string is Even-Odd Palindrome or not.  An Even-Odd Palindrome string is defined to… Read More »

## How to check if string contains only digits in Java

Given a string str, the task is to write a Java program to check whether a string contains only digits or not. If so, then… Read More »