
- Main
- Catalog
- Computer science
- Coding Interview
Coding Interview
Channel has quality stuff and active English speaking audience
Channel statistics
def reverse_string(s):
return s[::-1]
{}
C++:
string reverseString(string s) {
reverse(s.begin(), s.end());
return s;
}
{}
Java:
String reverseString(String s) {
return new StringBuilder(s).reverse().toString();
}
{}
2️⃣ Check for Palindrome
Q: Check if a string is a palindrome.
Python:
def is_palindrome(s):
s = s.lower().replace(" ", "")
return s == s[::-1]
{}
C++:
bool isPalindrome(string s) {
transform(s.begin(), s.end(), s.begin(), ::tolower);
s.erase(remove(s.begin(), s.end(), ' '), s.end());
return s == string(s.rbegin(), s.rend());
}
{}
Java:
boolean isPalindrome(String s) {
s = s.toLowerCase().replaceAll(" ", "");
return s.equals(new StringBuilder(s).reverse().toString());
}
{}
3️⃣ Count Vowels in a String
Q: Count number of vowels in a string.
Python:
def count_vowels(s):
return sum(1 for c in s.lower() if c in "aeiou")
{}
C++:
int countVowels(string s) {
int count = 0;
for (char c: s) {
c = tolower(c);
if (string("aeiou").find(c)!= string::npos)
count++;
}
return count;
}
{}
Java:
int countVowels(String s) {
int count = 0;
s = s.toLowerCase();
for (char c : s.toCharArray()) {
if ("aeiou".indexOf(c) != -1)
count++;
}
return count;
}
{}
4️⃣ Find Factorial (Recursion)
Q: Find factorial using recursion.
Python:
def factorial(n):
return 1 if n <= 1 else n * factorial(n - 1)
{}
C++:
int factorial(int n) {
return (n <= 1) ? 1 : n * factorial(n - 1);
}
{}
Java:
int factorial(int n) {
return (n <= 1) ? 1 : n * factorial(n - 1);
}
{}
5️⃣ Find Duplicate Elements in List/Array
Q: Print all duplicates from a list.
Python:
from collections import Counter
def find_duplicates(lst):
return [k for k, v in Counter(lst).items() if v > 1]
{}
C++:
vector<int> findDuplicates(vector<int>& nums) {
unordered_map<int, int> freq;
vector<int> res;
for (int n : nums) freq[n]++;
for (auto& p : freq)
if (p.second > 1) res.push_back(p.first);
return res;
}
{}
Java:
List<Integer> findDuplicates(int[] nums) {
Map<Integer, Integer> map = new HashMap<>();
List<Integer> result = new ArrayList<>();
for (int n : nums) map.put(n, map.getOrDefault(n, 0) + 1);
for (Map.Entry<Integer, Integer> entry : map.entrySet())
if (entry.getValue() > 1) result.add(entry.getKey());
return result;
}
{}
Double Tap ♥️ For MoreReviews channel
14 total reviews
- Added: Newest first
- Added: Oldest first
- Rating: High to low
- Rating: Low to high
Catalog of Telegram Channels for Native Placements
Coding Interview is a Telegram channel in the category «Интернет технологии», offering effective formats for placing advertising posts on TG. The channel has 51.8K subscribers and provides quality content. The advertising posts on the channel help brands attract audience attention and increase reach. The channel's rating is 12.5, with 14 reviews and an average score of 5.0.
You can launch an advertising campaign through the Telega.in service, choosing a convenient format for placement. The Platform provides transparent cooperation conditions and offers detailed analytics. The placement cost is 30.0 ₽, and with 86 completed requests, the channel has established itself as a reliable partner for advertising on Telegram. Place integrations today and attract new clients!
You will be able to add channels from the catalog to the cart again.
Комментарий