leetcode 1827 solution in java

Minimum Operations to Make the Array Increasing You are given an integer array nums (0-indexed). In one operation, you can choose an element of the array and increment it by 1. For example, if nums = [1,2,3], you can choose to increment nums[1] to make nums = [1,3,3]. Return the minimum number of operations needed…

leetcode 1816 solution in java

Truncate Sentence A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of only uppercase and lowercase English letters (no punctuation). For example, “Hello World”, “HELLO”, and “hello world hello world” are all sentences. You are given a sentence s​​​​​​…

What is the Difference between groupId and artifactId in Maven

The main difference between the groupId and artifactId is groupId specifies the ID of the project group while the artifactId specifies the id of the project. So group Id is always used to identify the project group and artifactId is used to identify the specific project that is developed by that particular group of organization….

What is Page Object Model (POM) in Selenium?

What is Page Object Model? It’s a design pattern , which is used by many test automation projects. The Page Object is basically a class file which acts as an interface of any web page. This class contains the web elements and many methods to interacts with those web-elements. And to interact with these pages,…

What is Encapsulation in Java?

Encapsulation is a technique to hide the nature of the declared variables within a class and this variables can only be accessed from another class via some public methods. Check the below example where the variable is declared as private and this variable can only be accessed from other class by using the public methods…