Skip to content

Pro Programming

Professional way of Programming

  • Home
  • C MCQs
  • C/C++
  • Java
  • Python
  • MySQL
  • Online Compiler
  • Topics
    • Arrays
    • Strings
    • Link Lists
    • Trees
    • Shapes
    • Articles
    • Games
    • Projects

c programming

Count number of equal pairs in a String in C++

Here we will first understand how to count number of equal pairs in a String using two methods, then we will write a C++ programs to implement these solutions. Given: A string s Problem: To find the number of equal pairs in the string s. Note: Pairs (s[i], s[j]), (s[j], s[i]), (s[i], s[i]), (s[j], s[j]) should be … Read more

Categories c programming, string Tags Count number of equal pairs in a string, string Leave a comment

Number of substrings of binary string containing K ones

In this post we will write a program in C++ to count the number of substrings of a binary string containing K ones, first we will discuss the problem with examples and then implement the solution in C++. Given: A binary string of length N and an integer K. Problem: Find out how many substrings of the given … Read more

Categories c programming, string Tags Count of substrings of a binary string containing K ones Leave a comment

Maximum points from top left to bottom right of Matrix

Given: Matrix of size MxN, consists of ‘#’, ‘.’ and ‘*’, where: # means blocked path . means walkable path * means points to collect. Problem: To find the maximum points you can grab to reach bottom right of the matrix from top left. Consider you are at the top left of the matrix, you have … Read more

Categories c programming, cpp codes Tags maximum points from top left of matrix to bottom right and return back Leave a comment

Highway Billboard Problem: Dynamic Programming

In this post we will understand the problem of Highway Billboard Problem and then we will implement the solution using Dynamic Programming. Problem: Let’s suppose we got a job to place billboards (advertising hoarding) on a National Highway of length M miles. The possible site for billboards are given by numbers x1 < x2 < ….. < … Read more

Categories c programming, cpp codes, Java, Python Tags highway billboard problem Leave a comment

Find length of the longest sub-sequence in C++

In this post first we are going to understand the problem to find the length of longest sub-sequence of an array and then we will write a C++ program to implement the same. Let’s understand the problem first: Given: An array arr[ ] of N integers. Problem: To find the length of the longest subsequence … Read more

Categories c programming, cpp codes Tags Longest subsequence such that adjacent elements have at least one common digit Leave a comment

Implement K stacks in single Array C++

Here first we are going to understand the problem of how to efficiently implement K Stacks in a single array, then we will discuss a solution and then finally we can implement the same in C++. Implement K Queues in single Array in C++ Problem: Create a data structure kStacks that represents k stacks. Implementation … Read more

Categories c programming, cpp codes Tags How to efficiently implement k Queues in a single array? Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page18 Next →
  • Email
  • Facebook
  • Twitter

Recent Posts

  • C/C++ Compiler for Android OS.
  • Simplest way to Rebuild GTID based replication using Mysqldump
  • MySQL skip slave error in GTID based Replication
  • RSA algorithm in C easy implementation
  • Download Turbo C++ for Windows 11, 10, 7, 8
  • N Queens problem implementation in Python
  • Upgrade MySQL 5.7 to 8 via Shell script
  • Monitor MySQL Error logs from AWS Cloudwatch
  • Python program to monitor disk usage in EC2
  • Simple MySQL Shell script for backup using Mysqldump
© 2023 Pro Programming • Built with GeneratePress
Next Page »