Skip to main content

Posts

Showing posts from 2022

Geek's Village and Well GFG solution in JAVA

 Geek's Village and Well Geek's village is represented by a 2-D matrix of characters of size n*m, where H - Represents a house W - Represents a well .- Represents open ground N - Prohibited area (Not allowed to enter in this area) Every house in the village needs to take the water from the well, as the family members are so busy with their work, so every family wants to take the water from the well in minimum time, which is possible only if they have to cover as less distance as possible. Your task is to determine the minimum distance that a person in the house should travel to take out the water and carry it back to the house. A person is allowed to move only in four directions left, right, up, and down. That means if he/she is the cell (ij), then the possible cells he/she can reach in one move are (i,j-1), (i,j+1),(i-1.j),(i+1,j), and the person is not allowed to move out of the grid.  Note: For all the cells containing 'N', 'W', and '.' our answer sho

Write a Program to perform the basic operations like insert, delete, display and search in a list. List contains String object items where these operations are to be performed.

 Operations on String List Write a Program to perform the basic operations like insert, delete, display and search in a list. List contains String object items where these operations are to be performed. Sample Input and Output:  1. Insert  2. Search  3. Delete  4. Display  5. Exit  Enter your choice: 1  Enter the item to be inserted:  Bottle  Inserted successfully  1. Insert  2. Search  3. Delete  4. Display  5. Exit  Enter your choice: 1  Enter the item to be inserted: Water  Inserted successfully  1. Insert  2. Search  3. Delete  4. Display  5. Exit  Enter your choice: 1  Enter the item to be inserted: Cap  Inserted successfully  1. Insert  2. Search  3. Delete  4. Display  5. Exit  Enter your choice: 1  Enter the item to be inserted: Monitor  Inserted successfully  1. Insert  2. Search  3. Delete  4. Display  5. Exit  Enter your choice: 2  Enter the item to search : Mouse  Item not found in the list.  1. Insert  2. Search  3. Delete  4. Display  5. Exit  Enter your choice: 2  Ente

Benefits and Drawback of Being Alone!

 BENEFITS and DRAWBACK of BEING ALONE! Its been almost a month for me to live on my own. I am here writing my thoughts and things I have seen these couple of weeks not everything but I'll try to keep it subtle. I have some friends here and at least I think that. There are some pros and cons of everything. BENEFITS OF LIVING ALONE 1. Personal alone time:- Most of us find this hard in our daily life. But it gets easier when you live alone. In this time, you can do anything you like reading a book, exercising, meditation or anything you like. Slowly, you will learn about the things and habits you like and the things you don't like. 2. Getting active, not lazy:-   When we are at home we build a habit not to work and it becomes harder to do daily works even for ourselves. Here you can cook on your own, make the bed and most importantly clean. Because you know that no one is going to do that for you. 3. Managing your expenses:- I belong to a middle-class family and they have set a bu