Sakshi Koshta has Published 25 Articles

Check if a number ends with another number or not

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 15:35:22

642 Views

A typical programming challenge is determining whether a number terminates with another number. To solve this problem, you must identify the last few digits of a given number and check to see if they match another number. Numerous applications, including data processing, string manipulation, and numerical analysis, frequently include this ... Read More

Smallest number possible by swapping adjacent even odd pairs

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 15:33:10

291 Views

"Even-odd pairs" means to pairings of two consecutive integers, one is even and the other odd. For example, even-odd pairs include (2, 3), (4, 5), (6, 7), etc. These pairings are commonly employed in number changing-based algorithms and programming exercises. When repeating over a set of numbers, like, one could ... Read More

How to validate Indian Passport number using Regular Expression?

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 15:28:56

4K+ Views

An Indian passport number is special alphanumeric code that Indian government issues to owner of an Indian passport. The passport number is made up of 8–12 characters, that may include both letters and digits. The first two characters of passport number indicate type of passport, such as P for an ... Read More

Count of distinct possible strings after performing given operations

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 15:24:21

381 Views

Determining the number of unique strings that can be­ obtained by performing a set of give­n operations on a string is a common challenge in compute­r science and mathematics. Se­veral operations, including character de­letion, swapping, or string reversal, can be­ carried out on the string. The obje­ctive is to calculate ... Read More

Check if there exists a permutation of given string which does not contain any monotonous substring

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 14:56:56

108 Views

A monotonous substring is a contiguous substring of given string containing characters whose values are all strictly increasing or strictly decreasing. A monotonous substring is a string sequence that either strictly increases or strictly decreases in value. Method Dynamic Programming Backtracking Method 1: Dynamic Programming One ... Read More

Split a binary string into K subsets minimizing sum of products of occurrences of 0 and 1

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 14:04:28

80 Views

A binary string is made up of a succession of binary numbers, also known as bits, that are either 0 or 1. It is a method of encoding data that uses only two numbers for computer applications where data is stored and processed using electronic circuits that can only recognise ... Read More

Check if a given string can be formed using characters of adjacent cells of a matrix

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 13:35:20

93 Views

Let's first understand the meaning of neighbour cells in matrices. To determine how each component fits into your two-dimensional matrix structure visualize each enclosed unit as being encompassed by almost eight adjacent elements positioned across/from them both diagonal directions in addition to vertical/horizontal ones. An example observation can be made ... Read More

Minimum addition/removal of characters to be done to make frequency of each character prime

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 13:29:57

52 Views

Optimising character frequency for primality is a challenging task in computer science that entails identifying the smallest number of character additions or removals required to make the frequency of each character in each string a prime integer. Cryptography, data reduction, and natural language processing are just a few of the ... Read More

Minimum flips required to generate continuous substrings of 0’s and 1’s

Sakshi Koshta

Sakshi Koshta

Updated on 31-Jul-2023 13:26:52

741 Views

Continuous character sequences known as substrings of 0s and 1s can be created by selecting zero or more characters from the original string in any order without skipping any of them. Take for instance the string "0101." The sub strings that are followed up this text are: 0, " "1, ... Read More

Longest Common Prefix in Linked List

Sakshi Koshta

Sakshi Koshta

Updated on 10-May-2023 16:25:54

263 Views

The longest common prefix problem is a well-known computer science problem that is frequently encountered when working with strings or lists. It entails determining the string or list element with the longest common prefix. When it comes to linked lists, there are several approaches that can be taken. One common ... Read More

Advertisements