Category "string"

Leetcode Reverse String problem not accepting in-place solution

I am posting two solutions below which I tried in leetcode for the problem no : 344 https://leetcode.com/problems/reverse-string/ Solution 1 class Solution: def

What are the best practices to display hardcoded pre-made long texts in an xcode project?

This will soon be my first time publishing an iOS app, and I just finished writing my privacy policy and terms & conditions texts. Best idea I came up with

How to compress a string consisting of only integers and two characters quickly?

I'm trying to implement custom images in Roblox I'm using method of importing and applying the colors of each pixel, but if I don't compress it, the memory is t

How to change 1.3445 to 13445, 2.4444 to 24444 , and keep 1.20 not change

How to change 1.3445 to 13445, 2.4444 to 24444 , and keep 1.20 not change. Thanks! md <- data.frame(value=c('1.3445','1.20','2.4444'))

error: request for member is of non-class type string & char

this is my Node Structure; class Node { public: string data; Node *next; Node *child; }; Node * createList(string *arr, int n) { Node *head = NU

How to set SharePoint path using a string variable on sheet

Dim path as String dim a as string dim b as string a = range("A4") // variable name in cell b = range("A106") // variable of other name in cell Workbooks.Open

Get rid of single quotes from the substituted string within sed command in Python

I have a text file 1.txt which has following content: module abc I am trying to generate multi-line string that I need to add before module abc line in 1.txt.

Reverse words in a string in C++ [duplicate]

Can anyone please tell that why the below written code isnt working , theres no error but its simply printing the string which was passed and

Simplify Path directory problem with stack

I need to implement a function to simplify the path of a directory for example "/home//foo/" need to be "/home/foo", i need to delete all the duplicate slashes

Modify user input to use in exec call

I am trying to modify a user input string to call execvp in a future function. In my code I have a function which tokenises the user input such that if the user

create string r using string p and q, C++, Data Structures, Strings [closed]

In this question we have given 3 strings and we nee dto count possible number of ways to create string r using string p and q

split string until a 5-7 digit number is found in python

I have strings like the following: 1338516 -...pair - 5pk 1409093 -...re Wax 3Pk 1409085 -...dtnr - 5pk 1415090 -...accessories 490663 - 3 pack 1490739 -...2 -

How to use .map to get sting from array

This is my first question because I'm just new to coding. I want to use .map to get strings from an array. let root_vegetables = ['potato', 'taro', 'sweet p

Automata and Strings

Can anyone help me with this exercise ? L = {w | w ends with a and does not contain bb} I do not know what I am doing wrong... I have tried creating a automato

Python - find pattern in file in max 4 lines of code

i have the following task. I have to find a specific pattern(word) in my file.txt(is a song centered on page) and to print out the row number + the row which ha

Python assigning the string to the variable - Str object is not callable message

I have the following problem where roles = models.StringField def role(player): if player.rank == 1: return 'leader' else: return 'memb

Remove pattern that occurs outside of words

I am trying to remove pattern 'SO' from the end of a character vector. The issue I run into with the below code is that it will remove any sequence of 'SO' case

What's wrong in my MIPS code about merge all separate input into a string?

.data string: .space 256 temp: .space 4 .text la $t0, string input: li $v0, 8 la $a0, temp li $a1, 4

Checking for Whether Both Expression Strings Contain the Variable

I had made a fully functioning method that would grab a variable string like x or var for the equation as so: // Equation Variable Getter public String getV

c++ find similar string in map/vector

Is there a c ++ function that finds all string occurrences above the map / vector that differ by max in 1 (generally n) character? Possibly some procedure that