Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
6 replies
66 views

I am a beginner learning GCSE level python, but stuck on this book problem Here, the num1.txt file data is appended to the temp1list num1.txt file data: 10,20,30,40 20,30,40,50 30,40,50,60 40,50,60,70 ...
nova's user avatar
  • 1
1 vote
2 answers
202 views

I need to solve a box stacking problem with the following rules: Box is a tuple {x, y, height}. You CAN NOT rotate boxes. To stack a box b1 on top of another box b2, b1.x<=b2.x and b1.y<=b2.y. ...
Pavlo Shevchyk's user avatar
0 votes
3 answers
119 views

I want to create a function called update in Python for a list dictionary but I don't have any idea how to do this. I tried to do reserch but the most common information shows how to do changes simply ...
user avatar
4 votes
1 answer
472 views

I am trying to solve a sorting problem in which it would be useful to determine the longest increasing subsequence in a circular buffer. As an example, let's take the following sequence: 5, 3, 4, 2, 1 ...
ismbks's user avatar
  • 98
0 votes
1 answer
230 views

I am trying to connect a pathology analyzer and receive data. Following is my code. private void ReceiveData(string IP, string PortNo) { var port = Convert.ToInt32(PortNo); ...
Shaiwal Tripathi's user avatar
1 vote
1 answer
50 views

This code finds the length of the longest subsequence in n.logn time but not the correct sequence. How to find the sequence that is longest in n.logn not the length? #include<bits/stdc++.h> #...
noobcodermousey's user avatar
1 vote
0 answers
139 views

The input is a list of integers and an integer k. The output has to be the length of the longest possible increasing subsequence of contiguous elements(neighbor elements, for example in '1 0 2' 1 and ...
DeliciousHippo's user avatar
0 votes
1 answer
156 views

Longest increasing subsequence, but with fenwick tree Where numbers can be non unique, positive, negative and up to +/- 2^31 Hi tried a lot, and it should work. But its slow. I know that segment ...
hopin's user avatar
  • 23
0 votes
1 answer
62 views

I need to evaluate my model's performance with limited training data. I am randomly selecting p of original training data. Assume p is 0.2 in this case. Here is some intil lines of code: p = p*100 ...
Ahmad's user avatar
  • 774
-3 votes
3 answers
69 views

I have a dictionary like below: my_dict = {'A' : [1, 2, 3, 4, 5], 'B' : [10, 1, 2, 5, 8], 'C': [6, 5, 3, 1]} I want to remove values less than 3 from "A" and "C" while B remains ...
Imran's user avatar
  • 71
0 votes
1 answer
97 views

I have used this code on my dataframe of sql queries to obtain list of dictionaries that has select, where, join columns: def augment(x): try: return Parser(x).columns_dict except: ...
python_pi's user avatar
  • 113
0 votes
0 answers
290 views

I'm working on a TCP communication program for the chemestry analyzer "Mindray BS240". The problem is that the analyzer keep disconnecting and reconnecting (every 30s). Here is my code, what ...
SidAhmed's user avatar
  • 2,350
-1 votes
1 answer
104 views

I have csv file in which keywords are given. I have to match all the words starting with the keywords from the text. text = "1 who were randomized 1 1 to daro 600 mg twice daily or matching pbo ...
Ad_sh's user avatar
  • 37
0 votes
2 answers
117 views

I'm trying to write a function which get: An integer. (s) A list with integers separated by math symbols.(L) By using recursion to determinate if the value of s can be calculate from the list by ...
Bar.'s user avatar
  • 1
0 votes
2 answers
152 views

I am trying to use a recursive function that prints all lists that has the maximum length out of the lists ( could be one or more if they have the same length) given an input such as : [[],[3],[2],[6]...
Raghad's user avatar
  • 55
0 votes
1 answer
257 views

I am trying to use a recursive function that prints the list that has the maximum length out of the lists resulting from my following code: allincreasing :: Ord a => [a] -> [[a]] allincreasing = ...
Raghad's user avatar
  • 55
1 vote
1 answer
175 views

The goal is to find the Longest Increasing Subsequence (LIS) of a list in Haskell. I tried to run the following code, but the error of couldn't find modules appeared. I saw answers to This question ...
Raghad's user avatar
  • 55
-1 votes
2 answers
68 views

How I want to order my list: isRegular = True bold = True italic = True The upper nearest value of weight. In my example, I want the nearest value to 400. My list contains these NamedTuple: class ...
jeremie bergeron's user avatar
0 votes
1 answer
224 views

I'm new to programming and I am using selenium to get data from scheduled matches from flashscore, I intend to assign each list returned from each loop to a variable so I can perform some calculations ...
JOJO's user avatar
  • 1
1 vote
1 answer
463 views

The Box Stacking Statement: Given n rectangle boxes, that the i box has height h[i], width w[i] and depth d[i]. Create a stack of boxes that is the tallest one possible, but only can stack a box on ...
aka61bt's user avatar
  • 57
0 votes
1 answer
247 views

def adjacent_sum(arr) narr = [] l = arr.length arr.each.with_index do |num,index| if index < arr.size-1 narr << arr[index] + arr[index+1] end end return narr end ...
Master of puppets's user avatar
-1 votes
1 answer
395 views

I have a list that returns two values at one position of the array. In the example is the 0 position of the array c. I want to know how to retrieve the first value and then the second value Thank you
Allanwa's user avatar
0 votes
1 answer
150 views

I looked at the following website describing the longest increasing subsequnce algorithm: https://www.fyears.org/2016/12/LIS.html In the section "how to reconstruct the subsequence?", it ...
cat_20's user avatar
  • 3
1 vote
2 answers
191 views

i've been trying to implement a cache in my recursive LIS function so it doesn't calculate the same value twice. I would really aprecciate if someone can give me a hint of what im getting wrong. This ...
timo fabregat's user avatar
0 votes
1 answer
639 views

I've tried to implement the n log n solution to the longest increasing subsequence problem (where you need to find a longest subsequence where each element is larger than the previous one of a given ...
Entman's user avatar
  • 697
0 votes
1 answer
243 views

Given an array and we can add or subtract some element an amount less than K to make the longest increasing subarray Example: An array a=[6,4,3,2] and K=1; we can subtract 1 from a[2]; add 1 to a[4] ...
emeralddd's user avatar
0 votes
3 answers
934 views

I got the following value in my list : A= [{'43c776cc-dcfe-498e-9e0c-465e498c4509'}, {'43c776cc-dcfe-498e-9e0c-465e498c4509'}, {'43c776cc-dcfe-498e-9e0c-465e498c4509'}, {'fbcbdda3-...
Filipe Wolfrum caeiros's user avatar
0 votes
1 answer
200 views

So I am trying to program Apriori Algorithm. I have here L1= ['apple', 'banana','orange','mango] This list already passed the support threshold, now I have to combine the items for another support ...
Messy Maze's user avatar
0 votes
3 answers
691 views

Given two arrays of numbers, how do I find the longest increasing subsequence by alternating between the elements of the two arrays? for example A = [4, 1, 10, 5, 9] B = [4, 5, 7, 14] so the output ...
GoldenDelphi's user avatar
0 votes
2 answers
55 views

I have two tables like : User: Id | Name | Age | 1 | Pankhuri | 24 2 | Neha | 23 3 | Mona | 25 And another Price log: Id | type | user_id | price | created_at| 1 | credit | 1 | 100 | 2021-...
Pankhuri's user avatar
0 votes
1 answer
112 views

I am reading about dynamic programming and was trying to solve the Longest Increasing subsequence problem. I tried to come up with a brute force recursion approach where I generated all possible ...
varunkr's user avatar
  • 5,552
0 votes
1 answer
82 views

I would like to solve the Longest increasing subsequence problem in Haskell, with the patience sorting algorithm. I first did it with lists, and it worked in O(n^2) time. Now I would like to do create ...
rambi's user avatar
  • 1,299
0 votes
1 answer
101 views

I have a dictionary like this verdict = {'1': 'PASS', '2': 'FAIL} I want to print this dictionary in a string format without using for loop. output: 1: PASS 2: FAIL So far I have tried this: print(*...
sam's user avatar
  • 233
0 votes
1 answer
151 views

I have to create .lis(output generated from SQR) type of file using python. I am not able to find any existing python package for it. please help. Thanks
sagar's user avatar
  • 1,505
0 votes
2 answers
147 views

I have a list that contains lists, examples: table[0] = ['255.255.255.255', '58267', '233', 'ESTABLISHED'] table[1] = ['255.132.0.0', '38367', '273', 'CLOSED'] I want to sort the list 'table' by the ...
Maya's user avatar
  • 57
0 votes
2 answers
2k views

I am having a following aggregation val df_date_agg = df .groupBy($"a",$"b",$"c") .agg(sum($"d").alias("data1"),sum($"e").alias(&...
Ayush Goyal's user avatar
3 votes
2 answers
4k views

I'm working on a LIS TCP communication service with the Mindray BC-5150 laboratory device, and I could not found where to put the communication settings (service address and port number),but I did ...
SidAhmed's user avatar
  • 2,350
2 votes
6 answers
2k views

I want to create a multi dimensional Array out of normal array. When there is a 0 in my start array i want to change the row number by 1. My start array looks like this: arr = [1, 2, 3, 0, 4, 5, 6, 0, ...
maja95's user avatar
  • 71
0 votes
1 answer
54 views

I have next code: listTest = ["ration","hello","exclamation"] word=['masha[a-z]*'] channels=['BOOMERANG','NICK'] targets=['KIDS','BOYS'] l=[] for j in range(22): ...
KLM's user avatar
  • 51
0 votes
0 answers
390 views

I have this question: Given the following: A = [9,6,9,3,8,9,2,0,4,12] C = [r,g,r,g,r,g,r,r,r,g] Where - r = red - g = green This list represent the color of the number in the same index in ...
Nathan Chan's user avatar
1 vote
1 answer
444 views

I am trying to solve uva's question 10534. The question is straight forward i.e Store LIS at each index i in array L1[]. Reverse the input array nums[]. Store LIS of this reverse array nums[] in L2[] ...
Abhishek Dasgupta's user avatar
0 votes
0 answers
188 views

This is the 1st time I am trying coding practices on platform like SPOJ. I have used bottom-up approach of dynamic programming and I am submitting below solution for finding maximum length of ...
vidhi shah's user avatar
-2 votes
1 answer
46 views

My code: text = [['Name', 'Surname', '2009']] What I tried to do: text[1]; I want so that the 'Surname' would print out, but I keep getting - IndexError: list index out of range.
lucutes's user avatar
-3 votes
1 answer
4k views

What is the complexity of the std::lower_bound and std::upper_bound functions. I know in case of std::set<int> it is log(n), but I have no idea for a std::vector<int>. I was going through ...
Harshit Gangwar's user avatar
3 votes
1 answer
1k views

Question - Given an array of integers, A of length N, find the length of longest subsequence which is first increasing then decreasing. Input:[1, 11, 2, 10, 4, 5, 2, 1] Output: 6 Explanation:[1 2 10 ...
utkarsh bajpai's user avatar
0 votes
1 answer
193 views

Hello every one i have string containing Address and list of Areas from Db, i want to get the area from address string which is present in both list of areas and address string.how can i do this ...
Awais Khan's user avatar
0 votes
2 answers
1k views

I am reading a file and using a regex on the file content to perform some operations. While reading the file, I don't find any special characters in it but after using the regex on the file content ...
gim carey's user avatar
2 votes
1 answer
148 views

I have found the following snippet in a code implementing a list class void push_front( const T & x ) { insert( begin( ), x ); } void push_front( T && x ) { insert( begin( ), std:...
asmmo's user avatar
  • 7,140
7 votes
1 answer
3k views

Why I created a duplicate thread I created this thread after reading Longest increasing subsequence with K exceptions allowed. I realised that the person who was asking the question hadn't really ...
Ermolai's user avatar
  • 323
0 votes
0 answers
208 views

We are developing LIS for Mindray BC 3600. When we are connecting to the analyser it is asking for "coldfire login:" and password. But neither the suppliers nor service center know what it is. Is ...
Sirojxuja Muminkhodjaev's user avatar