FastPrepMaximum String Operations
Problems/Maximum String Operations

Maximum String Operations

Atlassian logoAtlassian● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time online assessment. Our version follows the whole prompt as shown in the report.

Choose three consecutive characters whose first two are equal and whose third differs, then replace the third with the repeated character. Apply the operation any number of times and return the maximum possible operation count.

Function

getMaximumOperations(s: String) → long

Examples

Example 1

s = "accept"return = 3

The pair cc can successively absorb e, p, and t.

Example 2

s = "aabaab"return = 2

Two differing characters can be changed by the available repeated-a pairs.

Constraints

  • 3 <= s.length <= 200000
  • s contains lowercase English letters.

More Atlassian Online Assessment questions

  • Planning ProductionOA · Seen Feb 2025
  • K-Means ClusteringOA · Seen Feb 2025
  • Minimum Sorted Erasure OperationsOA · Seen Jun 2024
  • Count Analogous ArraysOA · Seen Mar 2024
  • Get Maximum ScoreOA · Seen Mar 2024
  • Better Compression 🦀OA · Seen Mar 2024
  • Romanizer 🐡OA · Seen Mar 2024
  • Flower Bouquets 💐OA · Seen Mar 2024
  • Binary Search Tree IteratorOA · Seen Nov 2023
  • Binary Tree Level Order TraversalOA · Seen Nov 2023

Similar questions at other companies

  • Lexicographically Largest IdentifierAmazon · OA
  • Lexicographically Smallest Grid Path with One Letter ChangeInfosys · OAInfosys interview questions
  • Longest Repeated Letter Block with Adjacent SwapsIntuit · OAIntuit interview questions
  • Binary CircuitAkuna Capital · OAAkuna Capital interview questions
  • Minimize Expression with ParenthesesPinterest · OAPinterest interview questions
  • Word Wrap with Even JustificationSentry · OA · PHONE SCREENSentry interview questions
  • Palindromic StringsNVIDIA · OANVIDIA interview questions
  • Get Patch SequenceMorgan Stanley · OAMorgan Stanley interview questions
  • Max Number of OperationsSalesforce · OASalesforce interview questions
  • Viral Content BalancerTikTok · OATikTok interview questions

Atlassian interview experiences

  • Atlassian MLE Phone Screen: Model Deployment Design: 1 Experience
  • Atlassian Coding Screens and Karat: 3 Experiences (Part 2 of 2)
  • Atlassian Full Stack Interviews: 11 Experiences (Part 1 of 2)
All Atlassian interview questionsSee Atlassian hiring insights
Saved
class Solution {
    public long getMaximumOperations(String s) {
      // Write your code here.
    }

}
Checking account…