Johnnn Blog

strategy for India to be world’s number 1 economy

strategy for India to be world’s number 1 economy

Becoming the world’s number one economy is a complex and long-term goal that requires a comprehensive strategy. Here are some key strategies that India could consider to enhance its economic growth and competitiveness: Infrastructure...

How do I mock an external dependency in Rust

How do I mock an external dependency in Rust

In Rust, you can mock an external dependency using various techniques, depending on the nature of the dependency. Here are a couple of commonly used approaches: Dependency injection: This involves structuring your code in...

write hello world program in COBOL

write hello world program in COBOL

Certainly! Here’s an example of a “Hello, World!” program written in COBOL: IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. AUTHOR. YOUR-NAME. PROCEDURE DIVISION. DISPLAY ‘Hello, World!’. STOP RUN. In COBOL, the program structure is divided into various...

Print all sub-arrays with 0 sum 0

Print all sub-arrays with 0 sum

Given an array of integers, it is often required to find all sub-arrays with a sum equal to 0. This problem can be solved using the hashing approach. Approach: Hashing The hashing approach involves...

n smallest element in an array 0

n smallest element in an array

Finding the X smallest elements in an array is a common problem in computer science and data analysis. The algorithm for finding the X smallest elements in an array can be implemented in various...

what is backtracking? 0

what is backtracking?

Backtracking is an algorithmic technique for solving problems by trying out different solutions and undoing them if they fail to reach the desired outcome. It is used to solve problems that involve searching through...