[How-To][Solved]Swagger-Ui not working

Fix Swagger UI Not Working in Spring Boot When setting up Swagger UI in a Spring Boot project, you may encounter issues getting it to display properly. Here is a checklist to troubleshoot and fix Swagger UI: 1. Add SpringFox Dependency Include the SpringFox Swagger dependency in your pom.xml: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> 2. … Continue reading [How-To][Solved]Swagger-Ui not working

[Java] Rotate array left or right n times

package com.abstractProgrammer; import java.util.Arrays; import java.util.stream.IntStream; public class Main { public static int[] rotateLeft(int[] arr, int numberOfRotation) { int[] temp = new int[numberOfRotation]; int finalNumberOfRotation = numberOfRotation % arr.length; System.arraycopy(arr, 0, temp, 0, numberOfRotation); IntStream .range(numberOfRotation, arr.length) .forEach(i -> arr[i - finalNumberOfRotation] = arr[i]); System.arraycopy(temp, 0, arr, arr.length - numberOfRotation, numberOfRotation); return arr; } public … Continue reading [Java] Rotate array left or right n times

[TCS NQT][2021] Find area of circle and print it up to 2 decimals.

both the coding questions of TCS NQT were very easy this time, This is one of them, hidden in the story of Jack who needs to find out the area of his circular ground, and he knows the radius( good for us 😬 ) the only condition is - radius 'r' must satisfy the condition … Continue reading [TCS NQT][2021] Find area of circle and print it up to 2 decimals.

[TCS NQT][2021] Mirror characters of a string

this is another one, wrapped in another story that someone is building a cryptographic program and they need to convert 'a' to 'z' , 'b' to 'x' and so on, Also known as mirror characters - Python - 1st approach chars = [chr(i) for i in range(97, 123)] reversed_char = [chr(i) for i in reversed(range(97, … Continue reading [TCS NQT][2021] Mirror characters of a string

Replace Words in a file and print count

JAVA import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; public class ReplaceWords { public static long countWords(String source, String wordToCount) { String[] words = source.split(" "); int count = 0; for (String word : words) { if (word.equals(wordToCount)) count++; } return count; } public static long replaceWords(String filePath , String[] wordsToReplace , String[] wordsToReplaceWith) throws … Continue reading Replace Words in a file and print count

[Programmers.Io] ‘CHOCX’ Cake Inventory

‘CHOCX’ is a bakery specialized in chocolate cakes. Their cake formula is - each cake contains 40% Bread, 10% Sugar, 30% Cream, 20% chocolate. They accept order via mail for X kg cake. In response, they confirm if they can deliver the cake with a “Thank you” or if they can’t with a “Sorry” note. When they respond they make sure, if any component is greater and equal to the required component, they retain 1 kg of each component Bread, Sugar, Cream, Chocolate in their inventory.

[JAVA] [Solved]>Malformed expression: “(ERROR)”<

So this Error came up when I was trying to code an assembler, the line that caused this was- obFW.write(OPTAB.getRecord(Line[1]).value); I solved it by first storing the Record, Returned by 'getRecord()' method, and then using the value of that Record. Maybe the error was caused because the returned object might no longer be in memory, … Continue reading [JAVA] [Solved]>Malformed expression: “(ERROR)”<